{include file="print_patient/element_print_header.html"}
<div align='center' style='padding: 15px 0px 15px 0px'>
	<span class='printHeader'>{translate}The medical profile{/translate}</span>
</div>
<span class='printHeader'>{translate}Demographic information{/translate}</span>
<table cellspacing="0" cellpadding="0" class='printDetails' style='width: 900px'>
    <tr>
        <td class="label">{translate}Patient's ID{/translate}</td>
        <td class="field" colspan="5">{$patient->getPatientCode()}</td>
    </tr>
    <tr>
        <td class="label">{translate}Full name{/translate}</td>
        <td class="field">{$person->getName()}</td>
        <td class="label">{translate}Gender{/translate}</td>
        <td class="field" colspan="3">{if $person->getGender()=="male" } {translate}Male{/translate} {elseif $person->getGender()=="female"} {translate}Female{/translate} {/if}</td>
    </tr>
    <tr>
        <td class="label">{translate}Date of birth{/translate}</td>
        <td class="field">{$person->getDateofBirth()}</td>
        <td class="label">{translate}Age{/translate}</td>
        <td class="field" colspan="4">{$person->getAge()}</td>
    </tr>
    <tr>
        <td class="label">{translate}Phone number{/translate}</td>
        <td class="field">{$person->getPhoneNumber()}</td>
        <td class="label">Email</td>
        <td class="field" colspan="4">{$person->get('email')}</td>
    </tr>
    <tr>
        <td class="label">{translate}Career{/translate}</td>
        <td class="field">{$person->getCareer()}</td>
        <td class="label">{translate}Working place{/translate}</td>
        <td class="field"  colspan="4">{$person->getWorkingPlace()}</td>
    </tr>
    <tr>
        <td class="label">{translate}Address{/translate}</td>
        <td class="field" colspan="5">{$person->getAddress()}</td>
    </tr>
    <tr>
        <td colspan="6"></td>
    </tr>   
    {if ($insurance->getInsuranceCode() != '')}
     <tr>       
        <td class="label">{translate}Medicial insurance No{/translate}</td>
        <td class="field">{$insurance->getInsuranceCode()} </td>
        <td class="label">{translate}Issue date{/translate}</td>
        <td class="field">{$insurance->getIssuedDate()}</td>
        <td class="label">{translate}Expired date{/translate}</td> 
        <td class="field">{$insurance->getExpiredDate()}</td>
      </tr>  
      <tr>
        <td class="label">{translate}Place of registered examination{/translate}</td>
        <td class="field" colspan="5">{$insurance->getRegisteredHospitalName()}</td>
      </tr>
    {else}
    <tr>
    	<td colspan="6" class="label">{translate}Patient is not supported by medicial insurance{/translate}</td>
    </tr>
    {/if}
    <tr>
        <td colspan="6"></td>
    </tr>
    <tr>
        <td class="label"><i>{translate}Relative name{/translate}</i></td>
        <td class="field">{$patient->getRelativeName()}</td>
        <td class="label"><i>{translate}Phone number{/translate}</i></td>
        <td class="field" colspan="3">{$patient->getRelativeNumber()}</td>
    </tr>
    <tr>
        <td class="label"><i>{translate}Address{/translate}</i></td>
        <td class="field" colspan="5">{$patient->getRelativeAddress()}</td>
    </tr>
</table>
<br/>
<span class='printHeader'>{translate}Personal information{/translate}</span>
<table id="patientIssues" class="printGrid" cellspacing="0" cellpadding="0">
	<thead>
		<tr>
			<th width='300px' class="first">{translateInformation/translate}</th>
			<th width='600px'>{translate}Content{/translate}</th>
		</tr>
	</thead>
	<tbody>
	{if !empty($patientIssues)}
	{foreach from=$patientIssues item=issue}
		<tr id="{$issue.id}">
			<td class="first">{$issue.name}</td>
			<td>{$issue.value}</td>
		</tr>
	{/foreach}
	{else}
		<tr>
			<td class="first" colspan='2'><i>{translate}There is no personal information{/translate}</i></td>
		</tr>
	{/if}
	</tbody>
</table>
<br/>
<span class='printHeader'>{translate}Allergic information{/translate}</span>
<table id="patientAllergy" class="printGrid" cellspacing="0" cellpadding="0">
	<thead>
		<tr>
			<th width="100px" class='first'>{translate}Time{/translate}</th>
			<th width="230px">{translate}Allergic agent{/translate}</th>
			<th width="420px">{translate}Description{/translate}</th>
			<th width="128px">{translate}Date updated{/translate}</th>
		</tr>
	</thead>
	<tbody>
	{if !empty($patientIssues)}		
	{foreach from=$patientAllergies item=allergy}
		<tr id='{$allergy.id}'>
			<td class='first'>
			{php}
				$allergy = $this->get_template_vars('allergy');
				echo Utils::trimDate('/', $allergy['date_admitted']);
			{/php}
			</td>
			<td>{$allergy.allergic_agent}</td>
			<td>{$allergy.note}&nbsp;</td>
			<td>{$allergy.updated}</td>
		</tr>
	{/foreach}
	{else}
		<tr>
			<td class="first" colspan='4'><i>{translate}There is no allergic information{/translate}</i></td>
		</tr>
	{/if}
	</tbody>
</table>
<br/>
<span class='printHeader'>{translate}Chronic disease information{/translate}</span>
<table id="patientChronics" class="printGrid" cellspacing="0" cellpadding="0">
	<thead>
		<tr>
			<th width="100px" class='first'>{translate}Time{/translate}</th>
			<th width="250px">{translate}Disease name{/translate}</th>
			<th width="150px">{translate}Status_1{/translate}</th>
			<th width="240px">{translate}Description{/translate}</th>
			<th width="127px">{translate}Date updated{/translate}</th>
		</tr>
	</thead>
	<tbody>	
	{if !empty($patientIssues)}  
	{foreach from=$patientChronics item=chronic}
		<tr id='{$chronic.id}'>
			<td class='first'>
			{php}
				$chronic = $this->get_template_vars('chronic');
				echo Utils::trimDate('/', $chronic['date_admitted']);
			{/php}
			</td>
			<td>{$chronic.disease_name}</td>
			<td>{if $chronic.status=='in_treatment'}{translate}In treatment{/translate}
				{elseif $chronic.status=='recovered'}{translate}Recovered{/translate}{/if}</td>
			<td>{$chronic.note}&nbsp;</td>
			<td>{$chronic.updated}</td>
		</tr>
	{/foreach}
	{else}
		<tr>
			<td class="first" colspan='5'><i>{translate}There is no chronic disease information{/translate}</i></td>
		</tr>
	{/if}
	</tbody>
</table>
<br/>
<span class='printHeader'>{translate}Other diseases information{/translate}</span>
<table id="patientOtherDiseases" class="printGrid" cellspacing="0" cellpadding="0">
	<thead>
		<tr>
			<th width="100px" class='first'>{translate}Time{/translate}</th>
			<th width="250px">{translate}Disease name{/translate}</th>
			<th width="150px">{translate}Status_1{/translate}</th>
			<th width="240px">{translate}Description{/translate}</th>
			<th width="127px">{translate}Date updated{/translate}</th>
		</tr>
	</thead>
	<tbody>	 
	{if !empty($patientIssues)} 
	{foreach from=$patientOtherDiseases item=disease}
		<tr id='{$disease.id}'>
			<td class='first'>
			{php}
				$disease = $this->get_template_vars('disease');
				echo Utils::trimDate('/', $disease['date_admitted']);
			{/php}
			</td>
			<td>{$disease.disease_name}</td>
			<td>{if $disease.status=='in_treatment'}{translate}In treatment{/translate}
				{elseif $disease.status=='recovered'}{translate}Recovered{/translate}{/if}</td>
			<td>{$disease.note}&nbsp;</td>
			<td>{$disease.updated}</td>
		</tr>
	{/foreach}
	{else}
		<tr>
			<td class="first" colspan='5'><i>{translate}There are no other diseases information{/translate}</i></td>
		</tr>
	{/if}
	</tbody>
</table>
</br>
<span class='printHeader'>{translate}Last surgical information{/translate}</span>
<table id="patientSurgeries" class="printGrid" cellspacing="0" cellpadding="0">
    <thead>
        <tr>
            <th width="100px" class='first'>{translate}Time{/translate}</th>
            <th width="250px">{translate}Surgery name{/translate}</th>
            <th width="150px">{translate}Surgery type{/translate}</th>
            <th width="240px">{translate}Description{/translate}</th>
            <th width="127px">{translate}Date updated{/translate}</th>
        </tr>
    </thead>
    <tbody>
    {if !empty($patientSurgeries)}
    {foreach from=$patientSurgeries item=surgery}
        <tr id='{$surgery.id}'>
            <td class='first'>
            {php}
				$surgery = $this->get_template_vars('surgery');
				echo Utils::trimDate('/', $surgery['surgery_date']);
			{/php}
            </td>
            <td>{$surgery.surgical_name}</td>
            <td>{if $surgery.surgery_type=='big'}{translate}Big surgery{/translate}
                {elseif $surgery.surgery_type=='medium'} {translate}Medium sugery{/translate}
                {elseif $surgery.surgery_type=='small'}{translate}Small surgery{/translate}{/if}</td>
            <td>{$surgery.note}&nbsp;</td>
            <td>{$surgery.updated}</td>
        </tr>
    {/foreach}
    {else}
    	<tr>
    		<td class="first" colspan='5'><i>{translate}There is no last surgical information{/translate}</i></td>
    	</tr>
    {/if}     
    </tbody>
</table>